package com.vue.vuedemo.service.impl;

import com.vue.vuedemo.dao.CommentMapper;
import com.vue.vuedemo.pojo.Comment;
import com.vue.vuedemo.service.CommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("CommentService")
public class CommentServiceImpl implements CommentService {

    @Resource
    CommentMapper commentMapper;

    @Override
    public List<Comment> findAll(Integer sId) {
        return commentMapper.findAll(sId);
    }

    @Override
    public void updateZan(Integer cId) {
        commentMapper.updateZan(cId);
    }

    @Override
    public void addComment(Comment comment) {
        commentMapper.addComment(comment);
    }

    @Override
    public List<Comment> pIdFindAll(Integer pId) {
        return commentMapper.pIdFindAll(pId);
    }

    @Override
    public void delComment(Integer cId) {
        commentMapper.delComment(cId);
    }
}
